package com.maiworld.api.controller;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.maiworld.seller.service.NewtableService;

@RestController
@RequestMapping("/news")
public class NewtableController {

	@Reference
	private NewtableService newtableService;
	
	//获取合同	(测试通过)
	@RequestMapping("/findOneNewsId")
	public Map<String, Object> findOneNewsId(Long id){
		System.out.print(id);
		return newtableService.findOneNewsId(id);
	}
	
	//返回某个车类型的报名价格信息表   (测试通过)
	@RequestMapping("/findAll")
	public Map<String, Object> findAll( String status, String type,String openid,String session_key){

		return newtableService.findAll(status,type);
	}
	
	//获取某一个班型的详细介绍 id:是班型的主键   (测试通过)
	@RequestMapping("/findOne")
	public Map<String, Object> findOne(Long sid, String status, Long id, String openid, String type,String session_key){
		return newtableService.findOne(sid, status, id, type);
		
	}
	
	/*//上传签约的图片，sid:用户主键
	@RequestMapping(value="add",method=RequestMethod.POST)
	public Map<String, Object> addNewtable(
			@RequestBody Map<String,String> params,Long sid
			){
		return  newtableService.addNewtable(params,sid);
	}*/
	
	//获取首页信息包括：轮播图、驾校简介、班型介绍    (测试通过)
	@RequestMapping("/index")
	public Map<String, Object> HomePageInformation(String status, String openid, Long sid) {
		return newtableService.HomePageInformation(status, openid, sid);
		
		
		
	}
	
}
